﻿using System.Windows;
using System.Windows.Input;
using test.ViewModels;
using test.Views;
using System.Drawing; // 图标
using System.Windows.Forms; // 引入托盘控件

namespace test
{
    public partial class MainWindow : Window
    {
        private MainViewModel _viewModel;
        

        public MainWindow()
        {
            InitializeComponent();
            _viewModel = new MainViewModel();
            this.DataContext = _viewModel;

        }
        protected override void OnStateChanged(EventArgs e)
        {
            base.OnStateChanged(e);
            if (WindowState == WindowState.Minimized)
            {
                this.Hide(); // 隐藏主窗口
            }
        }




    }
}
